{% extends 'base.html' %}
{% load template_helper %}

{% block body %}

<div class="am-g">
  <div class="am-u-sm-12 am-u-md-10 am-u-lg-8 am-u-sm-centered">
      <form class="am-form" id="postform" method="post" enctype="multipart/form-data">
        <div class="am-g">
        <div class="am-u-sm-10">
          <fieldset>
            {% for field in form %}
                    <div class="am-form-group am-form-group-sm">
                    <label>{{ field.label }} &nbsp;
                    <small>
                        {% if field.errors %}
                        <span class="am-text-danger">{{ field.errors | first }}</span>
                        {% else %}
                        {{ field.help_text | striptags }}
                        {% endif %}
                    </small></label>
                        {{ field | css:"am-form-field" }}
                    </div>
            {% endfor %}
          </fieldset>
          </div>
          <div class="am-u-sm-2">
              <h3>{{ request.user.nickname }}</h3>
            <img src="{{ request.user.get_mugshot_url }}" alt="..." class="am-img-thumbnail">
          </div>
        </div>
      {% csrf_token %}
        <div class="am-btn-group am-fr am-margin-right-lg am-margin-top">
          <a href="{% url 'password_change' %}" class="am-btn am-btn-primary">修改密码</a>
          <button type="button" onclick="history.back(-1)" class="am-btn am-btn-default">返回</button>
          <button type="submit" class="am-btn am-btn-default">提交</button>
        </div>
      </form>
  </div>
</div>

{% endblock %}